package JUC.JMM;

import java.util.concurrent.TimeUnit;

/**
 * @author mubei
 * @date 2021/11/23
 * @description
 */
public class JMMDemo {

    private volatile static int num = 0;
    public static void main(String[] args) throws InterruptedException {


        new Thread(()->{
            while(num == 0){
                //停的原因是  防止栈溢出
                //System.out.println("还在等待");
            }
        },"mubei").start();
        TimeUnit.SECONDS.sleep(2);
        num = 1;
    }
}
